package com.etrans.web.gps.business.gis.controller;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.etrans.web.gps.base.controller.BaseController;
import com.etrans.web.gps.business.gis.domain.CustomLine;
import com.etrans.web.gps.business.gis.domain.CustomLinePoint;
import com.etrans.web.gps.business.gis.domain.CustomMap;
import com.etrans.web.gps.business.gis.domain.CustomMapPoint;
import com.etrans.web.gps.business.gis.domain.TrackPlayBack;
import com.etrans.web.gps.business.gis.service.CustomLineService;
import com.etrans.web.gps.business.gis.service.CustomMapPointService;
import com.etrans.web.gps.business.gis.service.CustomMapService;
import com.etrans.web.gps.business.gis.service.TrackPlayBackService;
import com.etrans.web.gps.business.system.domain.SysUser;
import com.etrans.web.gps.common.Constant;
import com.etrans.web.gps.common.page.PageResultVo;
import com.etrans.web.gps.util.grid.FlexiGridUtil;

@Controller
@RequestMapping("/gis/matter")
public class MatterController extends BaseController {
	@Autowired
	private CustomMapPointService customMapPointService;

	@Autowired
	private CustomMapService customMapService;

	@Autowired
	private CustomLineService customLineService;
	
	@Autowired
    private TrackPlayBackService trackPlayBackService;

	/**
	 * 物流地图
	 * 
	 * @Description 页面跳转
	 * @param model
	 * @return
	 */
	@RequestMapping(value = "logisticsMap.html")
	public String index(Model model) {
		return "views/business/gis/matter";
	}

	/**
	 * 物流地图
	 * 
	 * @Description 查询自定义点
	 * @param paramsGrid
	 */
	@RequestMapping("queryCustomMapPoint.html")
	@ResponseBody
	public Map<String, Object> queryCustomMapPoint(String paramsGrid) {
		Map<String, Object> reslut = new HashMap<>();
		Map<String, Object> param = FlexiGridUtil.parseJSONParam(paramsGrid).getWhereParam();
		SysUser user = getSysUser();
		if(!user.isSuper_admin()){
			param.put("isSuperAdmin", user.getId());
		}
		List<CustomMapPoint> list = customMapPointService.queryAllCustomMapPoint((HashMap<String, Object>) param);
		reslut.put("rows", list);
		return reslut;
	}

	/**
	 * 物流地图
	 * 
	 * @Description 查询自定义线
	 * @param paramsGrid
	 */
	@RequestMapping("queryCustomLine.html")
	@ResponseBody
	public Map<String, Object> queryCustomLine(String paramsGrid) {
		Map<String, Object> reslut = new HashMap<>();
		Map<String, Object> param = FlexiGridUtil.parseJSONParam(paramsGrid).getWhereParam();
		SysUser user = getSysUser();
		if(!user.isSuper_admin()){
			param.put("isSuperAdmin", user.getId());
		}
		List<CustomLine> list = customLineService.queryAllCustomLine((HashMap<String, Object>) param);

		reslut.put("rows", list);
		return reslut;
	}

	/**
	 * 物流地图
	 * 
	 * @Description 查询自定义区域
	 * @param paramsGrid
	 */
	@RequestMapping("queryCustomMap.html")
	@ResponseBody
	public Map<String, Object> queryCustomMap(String paramsGrid) {
		Map<String, Object> reslut = new HashMap<>();
		Map<String, Object> param = FlexiGridUtil.parseJSONParam(paramsGrid).getWhereParam();
		SysUser user = getSysUser();
		if(!user.isSuper_admin()){
			param.put("isSuperAdmin", user.getId());
		}
		List<CustomMap> list = customMapService.queryAllCustomMap((HashMap<String, Object>) param);

		reslut.put("rows", list);
		return reslut;
	}

	/**
	 * 物流地图
	 * 
	 * @Description 保存自定义点
	 * @param paramsGrid
	 */
	@RequestMapping("saveCustomMapPoint.html")
	@ResponseBody
	public PageResultVo saveCustomMapPoint(String action,
			CustomMapPoint customMapPoint) {
		PageResultVo prv = new PageResultVo();
		try {
			SysUser user = getSysUser();
			HashMap<String,Object> param = new HashMap<String,Object>();
			param.put("name", customMapPoint.getName());
			param.put("id", customMapPoint.getId());
			if(!user.isSuper_admin()){
				param.put("isSuperAdmin", user.getId());
			}
			boolean isRe=customMapPointService.queryisReCustomMap(param);
			if(isRe){
				prv.setCode(2);
				prv.setData("");
				prv.setMsg("重复的名称！");
			}else{
				customMapPoint.setOriginlongitude(customMapPoint.getLon());
				customMapPoint.setOriginlatitude(customMapPoint.getLat());
				customMapPoint.setCreatorId(user.getId());
				if ("insert".equals(action)) {
					
					customMapPointService.saveCustomMapPoint(customMapPoint);// 直接保存
				}
				if ("update".equals(action)) {
					
					customMapPointService.updateCustomMapPoint(customMapPoint);
				}
				prv.setCode(0);
				prv.setData("");
				prv.setMsg("保存成功！");
			}
			
		} catch (Exception e) {
			prv.setCode(-1);
			prv.setData("");
			prv.setMsg("保存失败！");
		}
		return prv;
	}

	/**
	 * 物流地图
	 * 
	 * @Description 保存自定义线
	 * @param paramsGrid
	 */
	@RequestMapping("saveLine.html")
	@ResponseBody
	public PageResultVo saveLine(String action, CustomLine customLine) {
		PageResultVo prv = new PageResultVo();
		try {
			SysUser user = getSysUser();
			HashMap<String,Object> param = new HashMap<String,Object>();
			if(!user.isSuper_admin()){
				param.put("isSuperAdmin", user.getId());
			}
			param.put("name", customLine.getName());
			param.put("id", customLine.getId());
			boolean isRe=customLineService.queryisReCustomMap(param);
			if(isRe){
				prv.setCode(2);
				prv.setData("");
				prv.setMsg("重复的名称！");
			}else{
				customLine.setCreatorId(user.getId());
				if ("insert".equals(action)) {
					customLine.setStrokeColor("#330099");
					customLine.setStrokeWeight("4");
					customLine.setZoom("15");
					customLineService.saveCustomLine(customLine);// 直接保存
				} else if ("update".equals(action)) {
					customLine.setStrokeColor("#330099");
					customLine.setStrokeWeight("4");
					customLine.setZoom("15");
					customLineService.updateCustomLine(customLine);
				}
				prv.setCode(0);
				prv.setData("");
				prv.setMsg("保存成功！");
			}
			
		} catch (Exception e) {
			prv.setCode(-1);
			prv.setData("");
			prv.setMsg("保存失败！");
		}
		return prv;
	}
	
	
	/**
	 * 物流地图
	 * 
	 * @Description 保存自定义区域
	 * @param paramsGrid
	 */
	@RequestMapping("saveCustomMap.html")
	@ResponseBody
	public PageResultVo saveCustomMap(String action, CustomMap customMap) {
		PageResultVo prv = new PageResultVo();
		try {
			SysUser user = getSysUser();
			HashMap<String,Object> param = new HashMap<String,Object>();
			if(!user.isSuper_admin()){
				param.put("isSuperAdmin", user.getId());
			}
			param.put("name", customMap.getName());
			param.put("id", customMap.getId());
			boolean isRe=customMapService.queryisReCustomMap(param);
			if(isRe){
				prv.setCode(2);
				prv.setData("");
				prv.setMsg("重复的名称！");
			}else{
				String lonlat = customMap.getLonlat();

				customMap.setOriginlnglat(lonlat);
				customMap.setCreatorId(user.getId());
				if ("insert".equals(action)) {
					customMapService.saveCustomMap(customMap);// 直接保存
				}
				if ("update".equals(action)) {
					customMapService.updateCustomMap(customMap);
				}
				prv.setCode(0);
				prv.setData("");
				prv.setMsg("保存成功！");
			}
			
		} catch (Exception e) {
			prv.setCode(-1);
			prv.setData("");
			prv.setMsg("保存失败！");
		}
		return prv;
	}


	
	/**
	 * 物流地图
	 * 
	 * @Description 保存自定义区域
	 * @param paramsGrid
	 */
	@RequestMapping("isExistCustomcode.html")
	@ResponseBody
	public PageResultVo isExistCustomcode(String customcode,
			String id, String action, String workunitid) {
		PageResultVo prv = new PageResultVo();
		try {
			if(customMapPointService.checkCustomcode(customcode, id, workunitid) == null){
				prv.setCode(0);
				prv.setData("");
				prv.setMsg("重复的code！");
			}else{
				prv.setCode(1);
				prv.setData("");
				prv.setMsg("code可用！");
			}
			
		} catch (Exception e) {
			prv.setCode(-1);
			prv.setData("");
			prv.setMsg("验证失败失败！");
		}
		return prv;
	}
	
	/**
	 * 物流地图
	 * 
	 * @Description 根据ID获取自定义线路的点信息
	 * @param paramsGrid
	 */
	@RequestMapping("queryAllCustomLinePointById.html")
	@ResponseBody
	public PageResultVo queryAllCustomLinePointById(String lineID) {
		PageResultVo prv = new PageResultVo();
		List<CustomLinePoint> customLinePointList = null;
		try {
			customLinePointList = customLineService.queryAllCustomLinePointById(Integer.parseInt(lineID));
			prv.setCode(0);
			prv.setData(customLinePointList);
			prv.setMsg("查询成功！");
			
		} catch (Exception e) {
			prv.setCode(-1);
			prv.setData("");
			prv.setMsg("查询失败！");
		}
		return prv;
	}
	
	/**
	 * 物流地图
	 * 
	 * @Description 根据ID获取自定义线信息
	 * @param paramsGrid
	 */
	@RequestMapping("getCustomLineById.html")
	@ResponseBody
	public PageResultVo getCustomLineById(String id) {
		PageResultVo prv = new PageResultVo();
		CustomLine customLine = null;
		try {
			customLine = customLineService.queryCustomLineById(Integer.parseInt(id));
			prv.setCode(0);
			prv.setData(customLine);
			prv.setMsg("查询成功！");
			
		} catch (Exception e) {
			prv.setCode(-1);
			prv.setData("");
			prv.setMsg("查询失败！");
		}
		return prv;
	}
	
	
	/**
	 * 物流地图
	 * 
	 * @Description 根据ID获取自定义点信息
	 * @param paramsGrid
	 */
	@RequestMapping("getCustomMapPointById.html")
	@ResponseBody
	public PageResultVo getCustomMapPointById(String id) {
		PageResultVo prv = new PageResultVo();
		CustomMapPoint customMapPoint = null;
		try {
			customMapPoint = customMapPointService.queryCustomMapPointById(Integer.parseInt(id));
			prv.setData(customMapPoint);
			prv.setMsg("查询成功！");
			
		} catch (Exception e) {
			prv.setCode(-1);
			prv.setData("");
			prv.setMsg("查询失败！");
		}
		return prv;
	}

	/**
	 * 物流地图
	 * 
	 * @Description 根据ID获取自定义区域信息
	 * @param paramsGrid
	 */
	@RequestMapping("getCustomMapById.html")
	@ResponseBody
	public PageResultVo getCustomMapById(String id) {
		PageResultVo prv = new PageResultVo();
		CustomMap customMap = null;
		try {
			customMap = customMapService.queryCustomMapById(Integer.parseInt(id));
			prv.setData(customMap);
			prv.setMsg("查询成功！");
			
		} catch (Exception e) {
			prv.setCode(-1);
			prv.setData("");
			prv.setMsg("查询失败！");
		}
		return prv;
	}
	
	
	/**
	 * 物流地图
	 * 
	 * @Description 根据ID删除自定义线路信息
	 * @param paramsGrid
	 */
	@RequestMapping("delCustomLine.html")
	@ResponseBody
	public PageResultVo delCustomLine(String id) {
		PageResultVo prv = new PageResultVo();
		try {
			//目前尚未用到
			Long count =-1l;
	//		Long count = customLineService.queryCustomLineCountByCoverageGroups(Integer.parseInt(id));
			if (count > 0) {
				prv.setCode(2);
				prv.setData("");
				prv.setMsg("该线路已经设置报警，不能删除！");
			} else {
				customLineService.deleteCustomLineByID(Integer.parseInt(id));
				prv.setCode(0);
				prv.setData("");
				prv.setMsg("删除成功！");
			}
			
		} catch (Exception e) {
			prv.setCode(-1);
			prv.setData("");
			prv.setMsg("删除失败！");
		}
		return prv;
	}
	

	/**
	 * 物流地图
	 * 
	 * @Description 根据ID删除自定义点信息
	 * @param paramsGrid
	 */
	@RequestMapping("delCustomMapPoint.html")
	@ResponseBody
	public PageResultVo delCustomMapPoint(String id) {
		PageResultVo prv = new PageResultVo();
		try {
			customMapPointService.deleteCustomMapPointByID(Integer.parseInt(id));
			prv.setCode(0);
			prv.setData("");
			prv.setMsg("删除成功！");			
		} catch (Exception e) {
			prv.setCode(-1);
			prv.setData("");
			prv.setMsg("删除失败！");
		}
		return prv;
	}
	
	/**
	 * 物流地图
	 * 
	 * @Description 根据ID删除自定义区域信息
	 * @param paramsGrid
	 */
	@RequestMapping("delCustomMap.html")
	@ResponseBody
	public PageResultVo delCustomMap(String id) {
		PageResultVo prv = new PageResultVo();
		try {
			customMapService.deleteCustomMapByID(Integer.parseInt(id));
			prv.setCode(0);
			prv.setData("");
			prv.setMsg("删除成功！");			
		} catch (Exception e) {
			prv.setCode(-1);
			prv.setData("");
			prv.setMsg("删除失败！");
		}
		return prv;
	}

		
	
	private String formatMapTypeAction (int maptype)      
	{      
		String Result="";
		if(maptype==1){
			Result= "工厂";
		}else if(maptype==2){
			Result= "收费站";
		}else if(maptype==3){
			Result= "仓库";
		}else if(maptype==4){
			Result= "码头,堆场";
		}else if(maptype==5){
			Result= "物流园";
		}else if(maptype==6){
			Result= "其他";
		}else if(maptype==7){
			Result= "跟踪点";
		}else if(maptype==8){
			Result= "网点";
		} 
		return Result;
		
	} 
	
	/**
	 * 导出
	 * @return
	 */
	@RequestMapping(value="exportMatterInfo.html")
	@ResponseBody
	public void exportMatterInfo(HttpServletResponse response,HttpServletRequest request,  String name, String type, String colModel,
			String title,String imgsrc ){
		List<String> colModelList = JSON.parseObject(colModel, List.class);
		List<String> imgsrcList   = null;
		SysUser user = (SysUser)getSession().getAttribute(Constant.LOGIN_SESSION_NAME);

		Map<String, Object> paramMap=new HashMap<String, Object>();
		paramMap.put("name", name);
		paramMap.put("userId", user.getId());
		paramMap.put("isSuperAdmin",user.isSuper_admin());
		
		List<CustomMap> list1 =null;


		List<CustomLine> list2 =null;

		List<CustomMapPoint> list3  =null;
		List<HashMap<String, String>> rows = new ArrayList<HashMap<String, String>>();
		if(!user.isSuper_admin()){
			paramMap.put("isSuperAdmin", user.getId());
		}
		if("2".equals(type)){
			list1 = customMapService.queryAllCustomMap((HashMap<String, Object>) paramMap);

			
			for(CustomMap obj : list1){
				HashMap<String, String> map = new HashMap<String, String>();
				
				map.put("indexNum", obj.getIndexNum()+"");
				map.put("customcode", obj.getCustomcode());
				map.put("name", obj.getName());
				map.put("maptype", formatMapTypeAction(obj.getMaptype()));
				map.put("lat",  obj.getLat());		
				map.put("lon", obj.getLon());
				map.put("address",  obj.getAddress());		
				map.put("remark", obj.getRemark());
				rows.add(map);
			}
		}else if("1".equals(type)){
			list2 = customLineService.queryAllCustomLine((HashMap<String, Object>) paramMap);
			for(CustomLine obj : list2){
				HashMap<String, String> map = new HashMap<String, String>();
				
				map.put("indexNum", obj.getIndexNum()+"");
				map.put("customcode", obj.getCustomCode());
				map.put("name", obj.getName());
				map.put("startPoint",  obj.getStartPoint());
				map.put("endPoint",  obj.getEndPoint());
				map.put("mileage",  obj.getMileage());	
				map.put("remark", obj.getRemark());
				rows.add(map);
			}
		}else{
			
			list3 = customMapPointService
					.queryAllCustomMapPoint((HashMap<String, Object>) paramMap);
			for(CustomMapPoint obj : list3){
				HashMap<String, String> map = new HashMap<String, String>();
				
				map.put("indexNum", obj.getIndexNum()+"");
				map.put("customcode", obj.getCustomcode());
				map.put("name", obj.getName());
				map.put("maptype", formatMapTypeAction(obj.getMaptype()));
				map.put("radius",  obj.getRadius());		
				map.put("area", obj.getArea());
				map.put("lat",  obj.getLat());		
				map.put("lon", obj.getLon());
				map.put("address",  obj.getAddress());		
				map.put("remark", obj.getRemark());
				rows.add(map);
			}
		}
		
		
		int index=-1;
		List rowsList = new ArrayList<>();
		rowsList.add(rows);
		exportExl(request, response,title, removeHeadName(colModelList,index,-1),rowsList,imgsrcList);
		
		
	}
	
	
	/**
	 * 物流地图
	 * 
	 * @Description 保存轨迹线路
	 * @param paramsGrid
	 */
	@RequestMapping("saveTrackLine.html")
	@ResponseBody
	public PageResultVo saveTrackLine(String vehicleID,String startTime,String endTime,String name,String startPositionTrackLine,String endPositionTrackLine,String curTrackLineM) {
		PageResultVo prv = new PageResultVo();
		try {
			SysUser user = (SysUser)getSession().getAttribute(Constant.LOGIN_SESSION_NAME);
			HashMap<String,Object> param = new HashMap<String,Object>();
			param.put("userid", user.getId());
			param.put("name", name);
			CustomLine customLine = new CustomLine();
			customLine.setName(name);
			customLine.setStartPoint(startPositionTrackLine);
			customLine.setEndPoint(endPositionTrackLine);
			boolean isRe=customLineService.queryisReCustomMap(param);
			if(isRe){
				prv.setCode(2);
				prv.setData("");
				prv.setMsg("重复的名称！");
			}else{
		    	List<TrackPlayBack> lisTrackPlayBacks = trackPlayBackService.selectPlayBackTrack(vehicleID,startTime,endTime, -1, -1);
		    	List<CustomLinePoint> customLinePointList = new ArrayList<CustomLinePoint>();
		    	for(TrackPlayBack trackinfo : lisTrackPlayBacks ){
		    		CustomLinePoint point = new CustomLinePoint();
		    		point.setLatitude(trackinfo.getLatitude()+"");
		    		point.setLongitude(trackinfo.getLongitude()+"");
		    		point.setOriginlatitude(trackinfo.getLatitude()+"");
		    		point.setOriginlongitude(trackinfo.getLongitude()+"");
		    		customLinePointList.add(point);
		    		
		    	}
		    	if(customLinePointList.size()>1){
		    		customLine.setQdlatitude(customLinePointList.get(0).getLatitude());
			    	customLine.setQdlongitude(customLinePointList.get(0).getLongitude());
			    	customLine.setZdlatitude(customLinePointList.get(customLinePointList.size()-1).getLatitude());
			    	customLine.setZdlongitude(customLinePointList.get(customLinePointList.size()-1).getLongitude());
			    	customLine.setCustomLinePointList(customLinePointList);
					customLine.setStrokeColor("#330099");
					customLine.setStrokeWeight("4");
					customLine.setZoom("15");
					customLine.setMileage(curTrackLineM);
					customLineService.saveCustomTrackLine(customLine);// 直接保存

					prv.setCode(0);
					prv.setData("");
					prv.setMsg("保存成功！");
		    	}else{
		    		prv.setCode(2);
					prv.setData("");
					prv.setMsg("轨迹少于两条！");
		    	}
		    	
			}
			
		} catch (Exception e) {
			prv.setCode(-1);
			prv.setData("");
			prv.setMsg("保存失败！");
		}
		return prv;
	}
	
	
	/**
	 * 物流地图
	 * 
	 * @Description 保存轨迹线路
	 * @param paramsGrid
	 */
	@RequestMapping("saveTrackLineOps.html")
	@ResponseBody
	public PageResultVo saveTrackLineOps(String vehicleID,String startTime,String endTime,String name,String startPositionTrackLine,String endPositionTrackLine,String curTrackLineM) {
		PageResultVo prv = new PageResultVo();
		try {
			SysUser user = (SysUser)getSession().getAttribute(Constant.LOGIN_SESSION_NAME);
			HashMap<String,Object> param = new HashMap<String,Object>();
			param.put("userid", user.getId());
			param.put("name", name);
			CustomLine customLine = new CustomLine();
			customLine.setName(name);
			customLine.setStartPoint(startPositionTrackLine);
			customLine.setEndPoint(endPositionTrackLine);
			boolean isRe=customLineService.queryisReCustomMap(param);
			if(isRe){
				prv.setCode(2);
				prv.setData("");
				prv.setMsg("重复的名称！");
			}else{
		    	List<TrackPlayBack> lisTrackPlayBacks = trackPlayBackService.selectPlayBackTrack(vehicleID,startTime,endTime, -1, -1);
		    	List<CustomLinePoint> customLinePointList = new ArrayList<CustomLinePoint>();
		    	for(TrackPlayBack trackinfo : lisTrackPlayBacks ){
		    		CustomLinePoint point = new CustomLinePoint();
		    		point.setLatitude(trackinfo.getLatitude()+"");
		    		point.setLongitude(trackinfo.getLongitude()+"");
		    		point.setOriginlatitude(trackinfo.getLatitude()+"");
		    		point.setOriginlongitude(trackinfo.getLongitude()+"");
		    		customLinePointList.add(point);
		    		
		    	}
		    	if(customLinePointList.size()>1){
		    		customLine.setQdlatitude(customLinePointList.get(0).getLatitude());
			    	customLine.setQdlongitude(customLinePointList.get(0).getLongitude());
			    	customLine.setZdlatitude(customLinePointList.get(customLinePointList.size()-1).getLatitude());
			    	customLine.setZdlongitude(customLinePointList.get(customLinePointList.size()-1).getLongitude());
			    	customLine.setCustomLinePointList(customLinePointList);
					customLine.setStrokeColor("#330099");
					customLine.setStrokeWeight("4");
					customLine.setZoom("15");
					customLine.setMileage(curTrackLineM);
					customLineService.saveCustomTrackLine(customLine);// 直接保存

					prv.setCode(0);
					prv.setData("");
					prv.setMsg("保存成功！");
		    	}else{
		    		prv.setCode(2);
					prv.setData("");
					prv.setMsg("轨迹少于两条！");
		    	}
		    	
			}
			
		} catch (Exception e) {
			prv.setCode(-1);
			prv.setData("");
			prv.setMsg("保存失败！");
		}
		return prv;
	}
	
	
	/**
	 * 物流地图
	 * 
	 * @Description 查询自定义点
	 * @param paramsGrid
	 */
	@RequestMapping("queryCustomMapPointList.html")
	@ResponseBody
	public PageResultVo queryCustomMapPointList() {
		PageResultVo prv = new PageResultVo();
		Map<String, Object> param =  new HashMap<String, Object>();
		SysUser user = (SysUser)getSession().getAttribute(Constant.LOGIN_SESSION_NAME);
		param.put("userId",user.getId());
		param.put("isSuperAdmin",user.isSuper_admin());
		List<CustomMapPoint> list = customMapPointService
				.queryAllCustomMapPoint((HashMap<String, Object>) param);
		prv.setData(list);
		prv.setCode(0);
		prv.setMsg("查询成功");
		return prv;
	}

	/**
	 * 物流地图
	 * 
	 * @Description 查询自定义线
	 * @param paramsGrid
	 */
	@RequestMapping("queryCustomLineList.html")
	@ResponseBody
	public PageResultVo queryCustomLineList() {
		PageResultVo prv = new PageResultVo();
		Map<String, Object> param =  new HashMap<String, Object>();
		SysUser user = (SysUser)getSession().getAttribute(Constant.LOGIN_SESSION_NAME);
		param.put("userId",user.getId());
		param.put("isSuperAdmin",user.isSuper_admin());
		List<CustomLine> list = customLineService
				.queryAllCustomLine((HashMap<String, Object>) param);

		prv.setData(list);
		prv.setCode(0);
		prv.setMsg("查询成功");
		return prv;
	}

	/**
	 * 物流地图
	 * 
	 * @Description 查询自定义区域
	 * @param paramsGrid
	 */
	@RequestMapping("queryCustomMapList.html")
	@ResponseBody
	public PageResultVo queryCustomMapList() {
		PageResultVo prv = new PageResultVo();
		Map<String, Object> param =  new HashMap<String, Object>();
		SysUser user = (SysUser)getSession().getAttribute(Constant.LOGIN_SESSION_NAME);
		param.put("userId",user.getId());
		param.put("isSuperAdmin",user.isSuper_admin());
		List<CustomMap> list = customMapService
				.queryAllCustomMap((HashMap<String, Object>) param);

		prv.setData(list);
		prv.setCode(0);
		prv.setMsg("查询成功");
		return prv;
	}

}
